﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace DataAccess
{
   public class Redirector
   {
       public static void RedirectIfNotAuthenticated(string destPage)
       {
           HttpContext context = HttpContext.Current;
           if (context != null)
           {
               string page = context.Request.AppRelativeCurrentExecutionFilePath;
               if (context.User.Identity.IsAuthenticated == false)
               {
                   context.Response.Redirect(destPage);
               }
           }
       }
       public static void RedirectIfNotAuthenticated()
       {
           RedirectIfNotAuthenticated("~/DangNhap.aspx");
       }
   }
}
